import cn from 'classnames';
import { type FC, type PropsWithChildren } from 'react';

import Header from '../Header';
import UiContainer from '../UiContainer';

import type { PageProps } from './Page.props';

const Page: FC<PropsWithChildren<PageProps>> = ({ children, heading }) => {
  return (
    <>
      <Header />

      <UiContainer
        as={'main'}
        className={cn('py-[1rem]')}
      >
        {heading && (
          <h1
            className={cn(
              'font-bold text-2xl pb-[.5rem] mb-[1rem]',
              'border-b-[1px] border-b-neutral-400/50',
            )}
          >
            {heading}
          </h1>
        )}

        {children}
      </UiContainer>

      {/* Здесь будет футер */}
    </>
  );
};

export default Page;
